package com.mye.prometheusexportdcim.model.gaugeMetric;

import java.util.Objects;

/**
 * @author hch
 * @创建人 hch
 * @创建时间 2021/6/28 18:54
 * @描述 TODO
 * @版本 1.0.0
 */
public class SnmpInfo implements Cloneable {


    private String snmpAddress;


    private String oid;


   private Double value;

    public String getSnmpAddress() {
        return snmpAddress;
    }

    public void setSnmpAddress(String snmpAddress) {
        this.snmpAddress = snmpAddress;
    }

    public String getOid() {
        return oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    public Double getValue() {
        return value;
    }

    public void setValue(Double value) {
        this.value = value;
    }

    public SnmpInfo(String snmpAddress) {
        this.snmpAddress = snmpAddress;
    }


    @Override
    public SnmpInfo clone() {
        try {
            return (SnmpInfo) super.clone();
        } catch (CloneNotSupportedException e) {
            return new SnmpInfo(snmpAddress);
        }

    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        SnmpInfo snmpInfo = (SnmpInfo) o;
        return Double.compare(snmpInfo.value, value) == 0 &&
                Objects.equals(snmpAddress, snmpInfo.snmpAddress) &&
                Objects.equals(oid, snmpInfo.oid);
    }

    @Override
    public int hashCode() {
        return Objects.hash(snmpAddress, oid, value);
    }

    @Override
    public String toString() {
        return "SnmpInfo{" +
                "snmpAddress='" + snmpAddress + '\'' +
                ", oid='" + oid + '\'' +
                ", value=" + value +
                '}';
    }
}
